<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/maa.tld" prefix="m" %>
<html>
<head>
    <title>Admin cabinet</title>
</head>
<body>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="view-courses">
    <input type="submit" value="View courses"/>
</form>
<c:if test="${not empty courses}">
    <p><m:course-list courses="${courses}"/></p>
</c:if>
<c:if test="${not empty course_delete_error}">
    <font color="red"><%=session.getAttribute("course_delete_error")%>
    </font>
    <%session.removeAttribute("delete_error");%>
</c:if>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="hide-courses">
    <input type="submit" value="Hide courses"/>
</form>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="course-creation">
    <input type="submit" value="Add course"/>
</form>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="view-users">
    <input type="submit" value="View users"/>
</form>
<c:if test="${not empty users}">
    <p><m:user-list users="${users}"/></p>
</c:if>
<c:if test="${not empty user_delete_error}">
    <font color="red"><%=session.getAttribute("user_delete_error")%>
    </font>
    <%--use css instead font tag--%>
    <%session.removeAttribute("delete_error");%>
</c:if>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="hide-users">
    <input type="submit" value="Hide users"/>
</form>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="user-creation">
    <input type="submit" value="Add user"/>
</form>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="view-mentors">
    <input type="submit" value="View mentors"/>
</form>
<c:if test="${not empty mentors}">
    <m:mentor-list mentors="${mentors}"/>
</c:if>
<form action="/maa/do" method="get">
    <input type="hidden" name="action" value="hide-mentors">
    <input type="submit" value="Hide mentors"/>
</form>
<form action="/maa/do" method="get"><br>
    <input type="hidden" name="action" value="main"/>
    <input class="btn" type="submit" value="Return"/>
</form>
</body>
</html>
